#include<bits/stdc++.h>
using namespace std;
int n,a[200000],b[200000],ans,c[200000];
bool cmp(int x,int y){
    return (a[x]>y&&!b[x]);
}
int bound(int x){
    int l=1,r=n;
    while(l<r){
        int mid=(l+r)/2;
        if(cmp(mid,x))r=mid;
        else l=mid+1;
    }
    if(r!=n)return r;
    return -1;
}
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        c[a[i]]++;
    }
    sort(a+1,a+n+1);
    ans=0;
    for(int i=1;i<=n;i++){
        int k=bound(a[i]);
        if(k==-1)break;
        b[k]=1;
        a[i]=0;
    }
    for(int i=1;i<=n;i++)if(a[i])ans++;
    cout<<ans;
    return 0;
}
